package com.xx.createBean;

import com.xx.User;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class AnnotationCreateBean {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
        //applicationContext.register(User.class);
        applicationContext.scan("com.xx");
        applicationContext.refresh();

        User user = (User) applicationContext.getBean("user");
        System.out.println("user = " + user);
    }
}
